package entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="tb_student")
public class Student {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;
	private String name;
	private int age;
//	@ManyToOne(cascade=CascadeType.ALL,optional=true)
//	@JoinColumn(name="dep_id")
//	private Department dep;
	
	@OneToMany(mappedBy="stu_id")
	private List<score> cou = new ArrayList<>();
	public List<score> getCou() {
		return cou;
	}
	public void setCou(List<score> cou) {
		this.cou = cou;
	}
//	public Department getDep() {
//		return dep;
//	}
//	public void setDep(Department dep) {
//		this.dep = dep;
//	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
}
